using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmSynProgress : Form
	{
		private IContainer components = null;
		private Label lbMsg;
		private ProgressBar progressBar;
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.lbMsg = new Label();
			this.progressBar = new ProgressBar();
			base.SuspendLayout();
			this.lbMsg.Location = new System.Drawing.Point(12, 9);
			this.lbMsg.Name = "lbMsg";
			this.lbMsg.Size = new System.Drawing.Size(399, 12);
			this.lbMsg.TabIndex = 0;
			this.progressBar.Location = new System.Drawing.Point(14, 24);
			this.progressBar.Name = "progressBar";
			this.progressBar.Size = new System.Drawing.Size(397, 23);
			this.progressBar.TabIndex = 1;
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(423, 60);
			base.Controls.Add(this.progressBar);
			base.Controls.Add(this.lbMsg);
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "FrmSynProgress";
			base.ShowIcon = false;
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "日志同步进度";
			base.TopMost = true;
			base.Load += new EventHandler(this.FrmSynProgress_Load);
			base.ResumeLayout(false);
		}
		[DllImport("User32.dll")]
		private static extern int GetSystemMenu(int hWnd, int bRevert);
		[DllImport("User32.dll")]
		private static extern int EnableMenuItem(int hMenu, int nIDEnableItem, int nEnable);
		public void EnableCloseMenu(int hWnd)
		{
			int systemMenu = FrmSynProgress.GetSystemMenu(hWnd, 0);
			FrmSynProgress.EnableMenuItem(systemMenu, 61536, 3);
		}
		public void SetProgress(int i_min, int i_max, string aCaption)
		{
			this.lbMsg.Text = aCaption;
			this.progressBar.Value = 0;
			this.progressBar.Minimum = i_min;
			this.progressBar.Maximum = i_max;
		}
		public void SetValue(int i_value, string aCaption)
		{
			this.progressBar.Value = i_value;
			this.lbMsg.Text = aCaption;
		}
		public FrmSynProgress()
		{
			this.InitializeComponent();
		}
		private void FrmSynProgress_Load(object sender, EventArgs e)
		{
			this.EnableCloseMenu(base.Handle.ToInt32());
		}
	}
}
